



document.getElementById("search").onclick=function(){

    var request = new XMLHttpRequest();
    request.open("GET","   .php?成员="+document.getElementById("std_no").value);
    request.send();
    request.onreadystatechange=function(){
        if(request.readyState===4){
            if (request.status===200){ 
                var data=JSON.parse(request.responseText);
                if(data.success) {
                    document.getElementById("searchResult").innerHTML=data.msg;
                }else{
                    document.getElementById("searchResult").innerHTML="出现错误"+data.msg;
            }else{
                alert("发生错误"+request.status);
                }
            }
        }    
        
    }
}

document.getElementById("save").onclick=function(){

    var request = new XMLHttpRequest();
    request.open("POST","   .php");
    var data="std_name="+document.getElementById("std_name").value
    +"&std_tel_num="+document.getElementById("std_tel_num").value
    +"&std_no="+document.getElementById("std_no").value
    +"&std_addr="+document.getElementById("std_addr").value
    +"&std_email="+document.getElementById("std_email").value
    +"&std_paw="+document.getElementById("std_paw").value;
    request.setRequestHeader("content-Type","application/x-www-form-urlencoded");
    request.send(data);
    request.onreadystatechange=function(){
        if(request.readyState===4){
            if (request.status===200){ 
               var data=JSON.parse(request.responseText);
               if(data.success) {
                  document.getElementById("creatResult").innerHTML=data.msg;
               }else{
                  document.getElementById("creatResult").innerHTML="出现错误"+data.msg;
            }else{
                alert("发生错误"+request.status);
                }
            }
        }    
        
    }
}